fix(ec2): include supported usage classes in DescribeInstanceTypes - #3347
Conversation
|
| Filename | Overview |
|---|---|
| src/main/java/io/github/hectorvent/floci/services/ec2/Ec2InstanceTypeCatalog.java | Adds validated default usage-class metadata and includes it in instance-type response projections. |
| src/main/java/io/github/hectorvent/floci/services/ec2/Ec2QueryHandler.java | Emits supported usage classes using the AWS EC2 Query list shape. |
| compatibility-tests/sdk-test-java/src/test/java/com/floci/test/Ec2Tests.java | Verifies AWS SDK decoding for three representative instance types. |
| src/test/java/io/github/hectorvent/floci/services/stepfunctions/AslExecutorFailStateErrorCauseTest.java | Clarifies fixture documentation without changing test behavior. |
Reviews (8): Last reviewed commit: "test(ec2): document usage class regressi..." | Re-trigger Greptile
|
@luiseterc main is broken at the moment. PR #3345 will fix it, you can rebase main as soon this PR get merged. |
c5e402c to
de3920a
Compare
b7c7f19 to
aaab2cf
Compare
|
@hectorvent The current Build and Test failure is isolated to shard 3 and is unrelated to this EC2 PR. |
aaab2cf to
4524a8b
Compare
pgermosen
left a comment
There was a problem hiding this comment.
Checked this against the live InstanceTypeInfo docs and the values match exactly. I also didn't just trust that the on-demand/spot default was fine for the three types your test covers, I pulled the actual instance-type-catalog.yaml and checked all 15 entries in it, none are from a Capacity-Block-eligible family, so the default is accurate across the whole catalog as it stands today, not just the tested cases. Worth keeping in mind if a p5/trn-style type is ever added later without an explicit override, but that's not a problem here.
One small thing, there's an unrelated commit bundled in here (the stepfunctions test Javadoc comment) that isn't related to the EC2 fix. Harmless since it's comment-only, just flagging it since it'll look a little odd in the squashed history.
Summary
Fixes the EC2
DescribeInstanceTypesresponse so it includes the supported usage classes required by Karpenter and other AWS-compatible clients. Fixes #3346.Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Floci previously omitted
supportedUsageClassesfromDescribeInstanceTypes. Karpenter 1.8.8 interprets the missing field as no compatible capacity types and rejects on-demand NodeClaims beforeCreateFleet; the same directCreateFleetrequest succeeds. The catalog now returnson-demandandspot, and the query handler serializes both values using the AWS EC2 Query response shape.The change covers
m5.large,t4g.medium, andm6gd.large, the instance types exercised by the compatibility gate.Changes
supportedUsageClassesdata to the instance-type catalog, defaulting toon-demandandspot.<supportedUsageClasses><item>...</item></supportedUsageClasses>inDescribeInstanceTypes.Validation
./mvnw -q -DskipTests package./mvnw -q -Dtest=Ec2IntegrationTest testChecklist
./mvnw testpasses locally (targeted EC2 integration test and package build pass; full suite not run)